Summary of N4 Extensibility Features Not Using Framework Code Extensions

The below table summarizes N4 extensibility related features that have been around for long time and don't necessarily use new CARINA facilities that are discussed below.

Features/Topic

Brief Description

Additional Information and Link(s)

Groovy Plug-ins

The Groovy Plug-ins view in N4 provides a central repository of all Groovy code that can be shared across different calling points.
N4 > Administration > System > Groovy Plug-ins

The Groovy Plug-ins view displays any custom Groovy classes that you define for your site. The Groovy Plug-in provides a powerful extension of Navis N4. You can extend the system by inserting custom code and then triggering the code to execute by sending a JMS message into the system or by invoking it through a Web Service call.
In the list view, the Id column displays the Groovy class name and the Short Desc column displays a short description of the class.
You can add, edit, and delete custom-defined Groovy classes from this view.

This view is documented in the online documentation for N4.

Groovy Hooks

A Groovy hook is a N4 Groovy Plug-in that is deployed with a specific name (convention). N4 automatically loads and treats a groovy class (hook) as a business-flow interceptor that is invoked at a particular point in the application flow allowing extra validations.
You can think of a Groovy hook as dynamically inline'ing Groovy code into the N4 code.

N4 Groovy Hooks

Direct Code Injection

The Groovy Code Injection feature allows you to insert custom Groovy code into N4 and then use Web Services or JMS to send a command to execute that code.

Groovy Code Injection

On-Demand Web Services Written in Groovy

Please see Direct Code Injection above.

Groovy Code Injection

Pre-Deployed Groovy

You can use this feature to upload pre-deployed groovy code when you are loading the application to provide out-of-the-box sample Groovy code.
You cannot edit or delete the pre-deployed code; however, you can copy the pre-deployed code to create your own Groovy plug-in.

Groovy Pre-Deployed Plug-ins

Groovy Background Jobs

You can use this feature to:

Execute Groovy Plug-in(s) at periodic intervals.

Notify interested parties on the success or failure of the job.

Log the job.

Groovy Jobs

General Notices and Groovy

You can also extend N4 by injecting Groovy code that is executed when an Event occurs. This allows you to implement extensive customization, including:

Direct updates to the N4 domain model.

Trigger new events.

Send messages to outside systems.

Groovy Events

Gate Extensibility Using Groovy

You can extend N4 Gate Business Tasks using Groovy. You can add the groovy code to any gate business tasks to customize the functionality of the business task.

 

SNX and Groovy

Not only can you use SNX to export and import Groovy plug-ins, you can also use the SNX syntax to invoke Groovy code deployed as part of the Direct Code Injection feature listed above.

 

Groovy (Helper) API's

The following Groovy (Helper) API's are available in N4:

com.Navis.argo.business.api.GroovyAPI

com.Navis.argo.business.api.GroovyEvent

com.Navis.argo.business.api.GroovyQuery

com.Navis.services.business.event.GroovyEvent

com.Navis.apex.business.model.GroovyInjectionBase

Groovy Code Injection

Groovy Privileges and Settings

You can use the Groovy privileges to determine which users can add or edit Groovy codes and plug-ins. In addition, you can use the Groovy configuration settings to turn Groovy on or off for your N4 installation.

Groovy Privileges and Settings

N4 Mobile Applications and Additional Validations

Almost all of the N4 Mobile applications allow you to add custom validations during the Inspection or Reefer Monitoring processes.

N4 Groovy Hooks

Using the FORCE Button in a N4 Mobile Applications to Override Custom Validations

The linked document describes how to use Groovy Validations in a N4 Mobile application and how to use the FORCE Button to override these validations.

Groovy Based Validations in N4 Mobile Applications

Pre and Post Interception of WebServices

The N4 Generic WebServices are widely used in the Gate, Inventory, Billing, and other modules. These extension points allow you to pre and post process XML that is sent and returned by these webservices. This gives you the opportunity to adapt the XML into a format that N4 can process.

Code Extensibility Mechanisms in N4#Groovy Plug-ins for Pre and Post Processing of Generic WebServices Requests

Testing Groovy-WebServices

You can use the Administration > Debug > argoservice Tester view in N4 to test the Groovy webservices similar to the other webservices in N4.

 

Calling External WebServices

You can use this document to access the Framework documentation on how to call external webservices from within N4 processes.
To call external web services you must follow the process supported by the underlying Groovy library.
The document lists methods for Groovy 1.0 and higher versions. These methods are different depending on the version that you are using.

Please Note

N4 v. 2.1 uses the later version of Groovy; therefore, if you are migrating from an earlier version of N4, you must change your Groovy scripts.

Code Extensibility Mechanisms in N4#Calling Webservices from Groovy Code